package com.dps.recommend.metrics;

import com.dps.metrics.mapper.ResultTagMapper;
import org.springframework.util.CollectionUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DpsSenceResultTagMapper implements ResultTagMapper {


    @Override
    public Map<String, String> map(boolean isSuccess, Object result) {
        Map<String, String> tagMapper = new HashMap<>();
        try {
            List list = (List) result;
            tagMapper.put("empty", CollectionUtils.isEmpty(list) ? "true" : "false");
        } finally {
            return tagMapper;
        }
    }
}
